#ifndef BOARD_H
#define BOARD_H
#include <iostream>
#include <vector>
#include <utility>

/**
    Simple struct that encapsulates x,y coordinates
*/
struct Point
{
    Point() : x(0), y(0)
     {}
    Point(int ix, int iy ) :x(ix), y(iy) {}

    int x;
    int y;
};

/*struct Player
{
    Player(int n, char m) : number(n), mark(m) { }

    int number;
    char mark;
};*/

typedef std::vector<std::vector<char> > State; /**< Typedef for a multi-dimensional char-vector (the game board) */
typedef std::pair<Point,std::vector<Point> > MyPair; /**< Typedef for a multi-dimensional pair */


class Board
{
    public:
        Board(); /**< Constructor for the Board class */
        /**
            Overloaded constructor for the Board class
            @param[in] row Board rows
            @param[in] col Board columns
        */
        Board(int row, int col);
        virtual ~Board(); /**< Virtual destructor for the Board class */
        Board(const Board& other); /**< Copy constructor for the Board class */
        Board& operator=(const Board& other); /**< Assignment operator for the Board class */
        State getBoard() const; /**< Gets current board */
        void setBoard(State newBoard); /**< Sets current board */
        void printBoard(); /**< Prints the board */
        /**
            Moves player from some location to some location
            @param[in] player The player
            @param[in] From location
            @param[in] To location
        */
        void movePlayer(int player, Point from, Point to);
        /**
            Check if some location on board is occupied
            @param[in] point The location
        */
        bool isOccupied (Point point);
        /**
            Gets a certain row on the board
            @param[in] player Which player's row to get
            @returns Vector of the row
        */
        std::vector<char> getRow(int player);
        /**
            Outputs the game board into a Point vector
            @param[in] player The player to get positions for
            @returns Vector of Point objects for each position on the board
        */
        std::vector<Point> arrayOfPoints(int player);
        void initBoard(); /**< Initialize the game board */
        int getPieceRows() const; /**< Get how many rows you want for pieces */
        void setPieceRows(int n); /**< Sets how many rows you want for pieces */
        unsigned int getRows() const; /**< Returns board rows */
        unsigned int getCol() const; /**< Returns board columns */
        unsigned int getPieces(int player) const; /**< Returns piece count for player */
    private:
        unsigned int m_row; /**< Board rows */
        unsigned int m_col; /**< Board columns */
        unsigned int m_piece_rows; /**< How many rows there are for each player's pieces */
        State m_gameBoard; /** The game board */
};

#endif // BOARD_H
